<?php
/**
 * @package PHPKit.
 * @author: mawenpei
 * @date: 2016/11/28
 * @time: 11:44
 */
define('HHVM_VERSION',true);
require __DIR__ . '/../../../autoload.php';

include 'abcTask.php';

$config = require __DIR__ . '/config.php';
/*
$server = new swoole_http_server('127.0.0.1',9501);
$server->set($config['setting']);
$server->on('request',function($request,$response){
    $response->end('hello hello');
});
$server->start();
*/


$daemon = new \HuoKit\HuoServer\Daemon($config);

if (empty($argv[1]) || !in_array($argv[1], array('start', 'stop', 'restart', 'status')) ) {
    echo "Please input: bin/huoserver start|stop|restart|status\n";
    exit();
}
switch($argv[1]){
    case 'start':
        $daemon->start();
        break;
    case 'stop':
        $daemon->stop();
        break;
    case 'restart':
        $daemon->restart();
        break;
    default:
        break;
}
